package net.proef.jmock.lib.action;

import java.util.Arrays;
import java.util.List;

import org.hamcrest.Description;
import org.jmock.api.Action;
import org.jmock.api.Invocation;

public class ReturnArrayListAction implements Action {
    private List<?> list;

    public ReturnArrayListAction(Object... array) {
	this.list = Arrays.asList(array);
    }
    @Override
    public void describeTo(Description description) {
	description.appendValueList("return list of ", ", ", "", this.list);
    }

    @Override
    public List<?> invoke(Invocation invocation) throws Throwable {
	return this.list;
    }

}
